<template>
  <div class="radio-popup">
    <el-radio-group v-model="currentChecked" @change="radioChange">
      <el-radio v-for="(item, index) in list" :key="index" :label="item.value">{{ item.name }}</el-radio>
    </el-radio-group>
  </div>
</template>

<script setup>
import { defineProps, defineEmits, ref } from 'vue';
const props = defineProps(['list', 'checked']);
const emit = defineEmits(['change']);

const currentChecked = ref(props.checked);

const radioChange = () => {
  emit('change', currentChecked.value);
}
</script>

<style lang="less" scoped>
.radio-popup {
  padding: 10px 12px 12px;
}
</style>
